<div class="row">
    <div class="col-sm-6">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">Busqueda</h3>
            </div>
            <div class="panel-body">
                <form class="form-inline" name="frmMisPedidos" method="POST" role="form">
                    <fieldset>
                        <!-- <div class="form-group">
                            <label class="sr-only" for="ddlCarreras">Carrera</label>
                            <select class="form-control" name="ddlCarreras">
                                {combo_carreras}
                            </select>
                        </div> -->
                        <div class="form-group">
                            <label class="sr-only" for="ddlEstado">Estado</label>
                            <select class="form-control" name="ddlEstado">
                                {combo_estados}
                            </select>    
                        </div>
                        <button type="submit" name="btnFiltrar" class="btn btn-default">
                            <span class="glyphicon glyphicon-filter"></span> Filtrar
                        </button>
                    </fieldset>
                </form>
            </div>
        </div>
    </div>
    <div class="col-sm-6">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">Verificar estado</h3>
            </div>
            <div class="panel-body">
                <form id="frmVerificarPedido" class="form-inline" role="form">
                    <div class="form-group">
                        <label class="sr-only" for="txtEstadoIDPedido">ID Pedido</label>
                        <input type="text" class="form-control" id="txtEstadoIDPedido" name="txtEstadoIDPedido" placeholder="ID Pedido" required="required">
                    </div>
                    <div class="form-group">
                        <button id="btnVerEstadoPedido" type="submit" class="btn btn-default">
                            <span class="glyphicon glyphicon-search"></span> Verificar
                        </button>
                    </div>
                    <div class="form-group">
                        <strong>Estado:</strong> <span id="sEstadoIDPedido"></span>
                    </div>
                    <!-- <div class="form-group">
                        <strong>Pagado:</strong> <span id="sPagadoIDPedido"></span>
                    </div> -->
                </form>
            </div>
        </div>
    </div>
</div>
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">Resultados</h3>
    </div>
    <div class="panel-body">
        <div class="table-responsive">
            <table class="table table-hover">
                <thead>
                    <tr>
                        <th>N&ordm;</th>
                        <th>Legajo</th>
                        <th>Retiro</th>
                        <th>Estado</th>
                        <th>Creado</th>
                        <th>Acciones</th>
                    </tr>
                </thead>
                <tbody>
                    {table_content}
                </tbody>
            </table>
        </div>
    </div>
</div>
<script type="text/javascript">
    $("#frmVerificarPedido").submit(function(e) {
        e.preventDefault();
        if($("#txtEstadoIDPedido").val().length > 0) {
            $.ajax({
                url: "index.php?do=/gabinete/ajax_pedido_estado",
                type: "POST",
                data: {idPedido: $("#txtEstadoIDPedido").val()},
                success: function(data, textStatus, jqXHR) {
                    var ret = JSON.parse(data);
                    //console.debug(ret);
                    $("#sEstadoIDPedido").text(ret[0]);
                },
                error: function(jqXHR, textStatus, errorThrown) {
                    console.error(jqXHR, textStatus, errorThrown);
                }
            });
        };
    });
</script>